API Documentation
ContentLoader.h
1 // ContentLoader.h
3 //
5 
6 namespace nkGraphics
7 {
11  class ContentLoader final
12  {
13  public :
14 
29  static std::string inputDataStr (const nkMemory::StringView& filePath) ;
46  static bool outputData (const nkMemory::StringView& content, const nkMemory::StringView& path) ;
47 
48  // Save
56  static bool saveTreeDeclaration (nkExport::Node* tree, const nkMemory::StringView& pathFromData) ;
64  static bool saveObjectDeclaration (nkExport::Exportable* object, const nkMemory::StringView& pathFromData) ;
65 
66  // Textures
74  static ContentLoadResultTexture loadTextureDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
82  static ContentLoadResultTexture processTextureSources (const nkMemory::StringView& sources, bool loadResource = true) ;
90  static ContentLoadResultTexture processTextureTree (nkExport::Node* tree, bool loadResource = true) ;
91  // Samplers
99  static ContentLoadResultSampler loadSamplerDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
107  static ContentLoadResultSampler processSamplerSources (const nkMemory::StringView& sources, bool loadResource = true) ;
115  static ContentLoadResultSampler processSamplerTree (nkExport::Node* tree, bool loadResource = true) ;
116  // Shaders Program
124  static ContentLoadResultProgram loadShaderProgramDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
132  static ContentLoadResultProgram processShaderProgramSources (const nkMemory::StringView& sources, bool loadResource = true) ;
140  static ContentLoadResultProgram processShaderProgramTree (nkExport::Node* tree, bool loadResource = true) ;
141  // Shader Memory Slot
163  // Constant Buffer
185  // Compute Buffer
193  static ContentLoadResultBuffer loadBufferDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
201  static ContentLoadResultBuffer processBufferSources (const nkMemory::StringView& sources, bool loadResource = true) ;
209  static ContentLoadResultBuffer processBufferDeclarationTree (nkExport::Node* tree, bool loadResource = true) ;
210  // Shader
218  static ContentLoadResultShader loadShaderDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
226  static ContentLoadResultShader processShaderDeclarationSources (const nkMemory::StringView& sources, bool loadResource = true) ;
234  static ContentLoadResultShader processShaderDeclarationTree (nkExport::Node* tree, bool loadResource = true) ;
235  // Pass
257  // Compositor
265  static ContentLoadResultCompositor loadCompositorDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
273  static ContentLoadResultCompositor processCompositorSources (const nkMemory::StringView& sources, bool loadResource = true) ;
281  static ContentLoadResultCompositor processCompositorTree (nkExport::Node* tree, bool loadResource = true) ;
282  // Meshes
290  static ContentLoadResultMesh loadMeshDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
298  static ContentLoadResultMesh processMeshSources (const nkMemory::StringView& sources, bool loadResource = true) ;
306  static ContentLoadResultMesh processMeshTree (nkExport::Node* tree, bool loadResource = true) ;
307  // Nodes
329  // Blend States
337  static ContentLoadResultBlendState loadBlendStateDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
345  static ContentLoadResultBlendState processBlendStateSources (const nkMemory::StringView& sources, bool loadResource = true) ;
353  static ContentLoadResultBlendState processBlendStateTree (nkExport::Node* tree, bool loadResource = true) ;
354  // Depth Stencil States
362  static ContentLoadResultDepthStencilState loadDepthStencilStateDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
379  // Raster States
387  static ContentLoadResultRasterState loadRasterStateDeclaration (const nkMemory::StringView& pathFromData, bool loadResource = true) ;
395  static ContentLoadResultRasterState processRasterStateSources (const nkMemory::StringView& sources, bool loadResource = true) ;
403  static ContentLoadResultRasterState processRasterStateTree (nkExport::Node* tree, bool loadResource = true) ;
404  // Camera
426  // Render Queues
448 
479  } ;
480 }
nkGraphics::ContentLoader::loadCameraDeclaration
static ContentLoadResultCamera loadCameraDeclaration(const nkMemory::StringView &pathFromData)
nkGraphics::ContentLoader::inputData
static nkExport::ExporterLoadResult inputData(const nkMemory::StringView &filePath)
nkGraphics::ContentLoader::loadNodeDeclaration
static ContentLoadResultNode loadNodeDeclaration(const nkMemory::StringView &pathFromData)
nkGraphics::ContentLoader::loadShaderProgramDeclaration
static ContentLoadResultProgram loadShaderProgramDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::processCompositorTree
static ContentLoadResultCompositor processCompositorTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::appendCompositorNodeFromSources
static ContentLoadResultCompositorNode appendCompositorNodeFromSources(const nkMemory::StringView &sources, Compositor *parent)
nkGraphics::ContentLoader::processDepthStencilStateTree
static ContentLoadResultDepthStencilState processDepthStencilStateTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::loadShaderMemorySlotDeclaration
static ContentLoadResultShaderMemorySlot loadShaderMemorySlotDeclaration(const nkMemory::StringView &pathFromData)
nkGraphics::ContentLoader::processCameraSources
static ContentLoadResultCamera processCameraSources(const nkMemory::StringView &sources)
nkGraphics::ContentLoader::inputDataSources
static nkExport::ExporterLoadResult inputDataSources(const nkMemory::StringView &sources)
nkGraphics::ContentLoader::processCameraTree
static ContentLoadResultCamera processCameraTree(nkExport::Node *tree)
nkGraphics::ContentLoader::loadPassDeclaration
static ContentLoadResultPass loadPassDeclaration(const nkMemory::StringView &pathFromData)
nkGraphics::ContentLoader::loadCompositorDeclaration
static ContentLoadResultCompositor loadCompositorDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkExport::Exportable
An interface to define objects that can be exported using this component.
Definition: Exportable.h:15
nkGraphics::ContentLoader::loadDepthStencilStateDeclaration
static ContentLoadResultDepthStencilState loadDepthStencilStateDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::processSamplerSources
static ContentLoadResultSampler processSamplerSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processBlendStateSources
static ContentLoadResultBlendState processBlendStateSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processShaderDeclarationTree
static ContentLoadResultShader processShaderDeclarationTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::Compositor
A compositor, describing how to compose the rendering pipeline.
Definition: Compositor.h:21
nkGraphics::ContentLoader::loadBlendStateDeclaration
static ContentLoadResultBlendState loadBlendStateDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::processCompositorSources
static ContentLoadResultCompositor processCompositorSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processConstantBufferSources
static ContentLoadResultConstantBuffer processConstantBufferSources(const nkMemory::StringView &sources)
nkGraphics::ContentLoader::appendCompositorNodeFromTree
static ContentLoadResultCompositorNode appendCompositorNodeFromTree(nkExport::Node *tree, Compositor *parent)
nkGraphics::ContentLoader::processNodeSources
static ContentLoadResultNode processNodeSources(const nkMemory::StringView &sources)
nkExport::ExporterLoadResult
Holds the information about a try to import data sources.
Definition: ExporterLoadResult.h:15
nkGraphics::ContentLoader::loadMeshDeclaration
static ContentLoadResultMesh loadMeshDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::processConstantBufferDeclarationTree
static ContentLoadResultConstantBuffer processConstantBufferDeclarationTree(nkExport::Node *tree)
nkGraphics::ContentLoader::processRenderQueueTree
static ContentLoadResultRenderQueue processRenderQueueTree(nkExport::Node *tree)
nkGraphics::ContentLoader::saveTreeDeclaration
static bool saveTreeDeclaration(nkExport::Node *tree, const nkMemory::StringView &pathFromData)
nkGraphics::ContentLoader::loadRenderQueueDeclaration
static ContentLoadResultRenderQueue loadRenderQueueDeclaration(const nkMemory::StringView &pathFromData)
nkGraphics::ContentLoader::processRasterStateSources
static ContentLoadResultRasterState processRasterStateSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processShaderProgramSources
static ContentLoadResultProgram processShaderProgramSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processShaderProgramTree
static ContentLoadResultProgram processShaderProgramTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processShaderDeclarationSources
static ContentLoadResultShader processShaderDeclarationSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::appendCompositorNodeFromFile
static ContentLoadResultCompositorNode appendCompositorNodeFromFile(const nkMemory::StringView &pathFromData, Compositor *parent)
nkGraphics::ContentLoader::processShaderMemorySlotDeclarationTree
static ContentLoadResultShaderMemorySlot processShaderMemorySlotDeclarationTree(nkExport::Node *tree)
nkGraphics::ContentLoader::processBlendStateTree
static ContentLoadResultBlendState processBlendStateTree(nkExport::Node *tree, bool loadResource=true)
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkGraphics::ContentLoader::processShaderMemorySlotSources
static ContentLoadResultShaderMemorySlot processShaderMemorySlotSources(const nkMemory::StringView &sources)
nkGraphics::ContentLoader::processSamplerTree
static ContentLoadResultSampler processSamplerTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processPassTree
static ContentLoadResultPass processPassTree(nkExport::Node *tree)
nkGraphics::ContentLoader::loadSamplerDeclaration
static ContentLoadResultSampler loadSamplerDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoader
Utility class that allows to load content through their declaration files.
Definition: ContentLoader.h:12
nkGraphics::ContentLoader::loadRasterStateDeclaration
static ContentLoadResultRasterState loadRasterStateDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkGraphics::ContentLoader::processNodeTree
static ContentLoadResultNode processNodeTree(nkExport::Node *tree)
nkGraphics::ContentLoader::loadShaderDeclaration
static ContentLoadResultShader loadShaderDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::processBufferDeclarationTree
static ContentLoadResultBuffer processBufferDeclarationTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processTextureSources
static ContentLoadResultTexture processTextureSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processPassSources
static ContentLoadResultPass processPassSources(const nkMemory::StringView &sources)
nkGraphics::ContentLoader::loadBufferDeclaration
static ContentLoadResultBuffer loadBufferDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoader::processMeshSources
static ContentLoadResultMesh processMeshSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processBufferSources
static ContentLoadResultBuffer processBufferSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::loadTextureDeclaration
static ContentLoadResultTexture loadTextureDeclaration(const nkMemory::StringView &pathFromData, bool loadResource=true)
nkGraphics::ContentLoadResult
Holds information about an attempt of parsing content declaration sources.
Definition: ContentLoadResult.h:23
nkGraphics::ContentLoader::saveObjectDeclaration
static bool saveObjectDeclaration(nkExport::Exportable *object, const nkMemory::StringView &pathFromData)
nkGraphics::ContentLoader::processDepthStencilStateSources
static ContentLoadResultDepthStencilState processDepthStencilStateSources(const nkMemory::StringView &sources, bool loadResource=true)
nkGraphics::ContentLoader::processRenderQueueSources
static ContentLoadResultRenderQueue processRenderQueueSources(const nkMemory::StringView &sources)
nkGraphics::ContentLoader::processRasterStateTree
static ContentLoadResultRasterState processRasterStateTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics
Encompasses all API of component NilkinsGraphics.
Definition: BoundingBox.h:7
nkGraphics::ContentLoader::inputDataStr
static std::string inputDataStr(const nkMemory::StringView &filePath)
nkGraphics::ContentLoader::processMeshTree
static ContentLoadResultMesh processMeshTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::processTextureTree
static ContentLoadResultTexture processTextureTree(nkExport::Node *tree, bool loadResource=true)
nkGraphics::ContentLoader::outputData
static bool outputData(const nkMemory::StringView &content, const nkMemory::StringView &path)
nkGraphics::ContentLoader::loadConstantBufferDeclaration
static ContentLoadResultConstantBuffer loadConstantBufferDeclaration(const nkMemory::StringView &pathFromData)